<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:61:"D:\phpstudy_pro\WWW\hsycmsv1/app/hsycms\view\article\add.html";i:1534993784;s:60:"D:\phpstudy_pro\WWW\hsycmsv1\app\hsycms\view\index\head.html";i:1533175385;}*/ ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HSYCMS后台管理系统</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<link rel="stylesheet" href="/public/layui/css/layui.css?v=<?php echo time(); ?>" />
<link rel="stylesheet" type="text/css" href="/public/admin/css/touchTouch.css?v=<?php echo time(); ?>">
<link rel="stylesheet" href="/public/admin/css/admin.css?v=<?php echo time(); ?>" />
<script src="/public/admin/js/jquery.js?v=<?php echo time(); ?>"></script>
<script src='/public/tinymce/tinymce.min.js'></script>
<script src="/public/admin/js/validform5.3.2min.js"></script>
<script src="/public/layer//layer.js?v=<?php echo time(); ?>"></script>
<script src="/public/layui/layui.js?v=<?php echo time(); ?>"></script>
<script src="/public/admin/js/touchTouch.jquery.js"></script> 
<script src="/public/admin/js/admin.js?v=<?php echo time(); ?>"></script>
</head>
<body>

<div class="box">
  <form method="post" action="<?php echo url('add'); ?>" class="sycmsform">
    <div class="box-head">
      <ul class="bhtab">
        <li class="on"><a href="javascript:void(0);"><i class="icon-comment"></i> 基本信息</a></li>
        <li><a href="javascript:void(0);"><i class="icon-paper-plane"></i> 其他信息</a></li>
      </ul>
      <div class="fr">
        <button type="submit" class="btn"><i class="icon-check"></i><?php echo !empty($v['id'])?'编辑':'添加'; ?></button>
        &nbsp;<a href="javascript:history.go(-1);" class="btn fr"><i class="icon-mail-reply (alias)"></i>返回</a></div>
    </div>
    <div class="form">
    <input type="hidden" name="id" value="<?php echo $v['id']; ?>" />
    <input type="hidden" name="nid" value="<?php echo $nid; ?>" />
    <input type="hidden" name="mid" value="<?php echo $mid; ?>" />
    <ul class="tabcon" style="display:block;">
      <li>
        <label>标题：</label>
        <div class="item">
          <input type="text" name="title" value="<?php echo $v['title']; ?>" class="input w60" datatype="*" nullmsg="请输入标题"/>
        </div>
      </li>
      <li>
        <label>副标题：</label>
        <div class="item">
          <input type="text" class="input" name="subtitle" value="<?php echo $v['subtitle']; ?>" />
        </div>
      </li>
      <!-- 案例 -->
      <?php if($nid == 91 || $nid == 85): ?>
      <li>
        <label>上线地址：</label>
        <div class="item">
          <input type="text" name="url" value="<?php echo $v['url']; ?>" class="input"/>
          <div class="clear"></div>          
        </div>
      </li>      
      <?php endif; if($iscid == 1): ?>
      <li>
        <label>所属分类：</label>
        <div class="item">
          <div class="select"><i class="icon-caret-down"></i>
            <input type="hidden" name="cid" value="<?php echo $v['cid']; ?>" class="inputval"  />
            <input type="text" readonly placeholder="请选择分类" value="" class="input" datatype="*" nullmsg="请选择分类"/>
            <dl class="select-value syui-anim syui-anim-up">
              <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>                         
              <dd data="<?php echo $vo['id']; ?>" <?php if($vo['id'] == $v['cid']): ?>class=selected<?php endif; ?>><?php echo $vo['title']; ?></dd>                           
              <?php if(is_array($vo['son']) || $vo['son'] instanceof \think\Collection || $vo['son'] instanceof \think\Paginator): $i = 0; $__LIST__ = $vo['son'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vs): $mod = ($i % 2 );++$i;?>
              <dd data="<?php echo $vs['id']; ?>" <?php if($vs['id'] == $v['cid']): ?>class=selected<?php endif; ?>>&nbsp;&nbsp;&nbsp;|--<?php echo $vs['title']; ?></dd>
              <?php if(is_array($vs['son']) || $vs['son'] instanceof \think\Collection || $vs['son'] instanceof \think\Paginator): $i = 0; $__LIST__ = $vs['son'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vc): $mod = ($i % 2 );++$i;?>
              <dd data="<?php echo $vc['id']; ?>" <?php if($vc['id'] == $v['cid']): ?>class=selected<?php endif; ?>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|----<?php echo $vc['title']; ?></dd>              
              <?php endforeach; endif; else: echo "" ;endif; endforeach; endif; else: echo "" ;endif; endforeach; endif; else: echo "" ;endif; ?>
            </dl>
          </div>
        </div>
      </li> 
      <?php endif; ?>      
      <li>
        <label>属性：</label>
        <div class="item radio">
          <span><input type="checkbox" onclick="_checkbox('ishome')" <?php if($v['ishome'] == 1): ?> checked="checked" <?php endif; ?> /> 首页</span>
          <span><input type="checkbox" onclick="_checkbox('isvouch')" <?php if($v['isvouch'] == 1): ?> checked="checked" <?php endif; ?>/> 推荐</span>
          <span><input type="checkbox" onclick="_checkbox('istop')" <?php if($v['istop'] == 1): ?> checked="checked" <?php endif; ?>/> 置顶</span>
          <input type="hidden" name="ishome" value="<?php echo (isset($v['ishome']) && ($v['ishome'] !== '')?$v['ishome']:0); ?>"  />
          <input type="hidden" name="isvouch" value="<?php echo (isset($v['isvouch']) && ($v['isvouch'] !== '')?$v['isvouch']:0); ?>" />
          <input type="hidden" name="istop" value="<?php echo (isset($v['istop']) && ($v['istop'] !== '')?$v['istop']:0); ?>"  />
        </div>
      </li>
      <li>
        <label>列表图片：</label>
        <div class="item">
          <input type="text" name="img" value="<?php echo $v['img']; ?>" class="input"/>
          <button type="button" class="button fl" onclick="sycms.showupload(this)" id="image1" at="dg"><i class="icon-plus"></i>上传图片</button>
          <span class="tips"><?php echo $v['imgtips']; ?></span>
          <div class="clear"></div>
          <div class="input-image"><?php if($v['img']): ?><img src="<?php echo $v['img']; ?>" alt="" /><?php endif; ?></div>
        </div>
      </li>
      <!-- 产品模块 -->
      <?php if($mid == 3): ?>    
      <li>
        <label>多图：</label>
        <div class="item">
          <dl class="uploadListImg">
          <?php if(is_array($v['imgs']) || $v['imgs'] instanceof \think\Collection || $v['imgs'] instanceof \think\Paginator): $i = 0; $__LIST__ = $v['imgs'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
          <dd><a href="<?php echo $vo; ?>" class="imgview"><img src="<?php echo $vo; ?>" /></a><input type="hidden" name="imgs[]" value="<?php echo $vo; ?>" /><span onclick="sycms.removeImg(this)">x</span></dd>
          <?php endforeach; endif; else: echo "" ;endif; ?>
          <dd><a href="javascript:void(0);" onclick="sycms.showupload(this)" id="image2" class="upimgadd" at="pl"></a></dd>
          </dl>       
        </div>
      </li>
      <?php endif; ?>        
      <!-- 下载模块 -->
      <?php if($mid == 4): ?>
      <li>
        <label>下载地址：</label>
        <div class="item">
          <input type="text" name="file" value="<?php echo $v['file']; ?>" class="input"/>
          <button type="button" class="button fl" onclick="sycms.showupfile(this)" id="uploadfile" at="file"><i class="icon-plus"></i>上传文件</button>
          <div class="clear"></div>          
        </div>
      </li>      
      <?php endif; ?>      
       <!-- 视频模块 -->
      <?php if($mid == 5): ?>
      <li>
        <label>视频地址：</label>
        <div class="item">
          <input type="text" name="url" value="<?php echo $v['url']; ?>" class="input"/>
          <button type="button" class="button fl" onclick="sycms.showupfile(this)" id="uploadfile2" at="video"><i class="icon-plus"></i>上传视频</button>
          <div class="clear"></div>          
        </div>
      </li>      
      <?php endif; if($mid == 3): ?> 
      <!--产品描述加编辑器-->      
      <li style="margin-bottom:15px; overflow:hidden;">
        <label>描述：</label>
        <div class="item">
          <textarea type="text" class="input w100 editor" name="note"  style="height:150px;"><?php echo htmlspecialchars_decode($v['note']); ?></textarea>
        </div>
      </li>
      <?php else: ?>
       <li style="margin-bottom:15px; overflow:hidden;">
        <label>描述：</label>
        <div class="item">
          <textarea type="text" class="input w100" name="note"  style="height:80px;"><?php echo $v['note']; ?></textarea>
        </div>
      </li>
      <?php endif; ?>
      
      <li style="margin-bottom:15px; overflow:hidden;">
        <label>内容：</label>
        <div class="item">
          <textarea type="text" class="input w100 editor" name="content"  style="height:450px; width:100%;"><?php echo htmlspecialchars_decode($v['content']); ?></textarea>          
        </div>
      </li>       
      <?php if($mid == 3): ?> 
      <li style="margin-bottom:15px; overflow:hidden;">
        <label>产品参数：</label>
        <div class="item">
          <textarea type="text" class="input w100 editor" name="content1"  style="height:450px; width:100%;"><?php echo htmlspecialchars_decode($v['content1']); ?></textarea>          
        </div>
      </li> 
      <?php endif; ?>    
    </ul>
    <!-- 其他信息 -->
    <ul class="tabcon">
      <li>
        <label>SEO标题：</label>
        <div class="item">
          <input type="text" class="input w100" value="<?php echo $v['seo_title']; ?>" name="seo_title"  />
        </div>
      </li>
      <li>
        <label>SEO关键字：</label>
        <div class="item">
          <input type="text" class="input w100" value="<?php echo $v['seo_keywords']; ?>" name="seo_keywords"  />
        </div>
      </li>
      <li>
        <label>SEO描述：</label>
        <div class="item">
          <textarea type="text" class="input w100" name="seo_description"><?php echo $v['seo_description']; ?></textarea>
        </div>
      </li>
      <li style="margin-top:15px;">
        <label>排序：</label>
        <div class="item">
          <input type="text" class="input" type="number" value="<?php echo (isset($v['sort']) && ($v['sort'] !== '')?$v['sort']:0); ?>" name="sort"  />
        </div>
      </li>
      <li>
        <label>作者：</label>
        <div class="item">
          <input type="text" class="input" type="text" value="<?php echo (isset($v['author']) && ($v['author'] !== '')?$v['author']:'admin'); ?>" name="author"  />
        </div>
      </li>
      <li>
        <label>来源：</label>
        <div class="item">
          <input type="text" class="input" type="text" value="<?php echo (isset($v['source']) && ($v['source'] !== '')?$v['source']:'本站'); ?>" name="source"  />
        </div>
      </li>
      <li>
        <label>发布时间：</label>
        <div class="item">
          <input type="text" class="input icon-date" type="text" id="datetime" value="<?php if($v['datetime']): ?><?php echo date('Y-m-d H:i:s',$v['datetime']); endif; ?>" name="datetime"  />
        </div>
      </li>
    </ul>    
    <ul>
      <li>
        <label>&nbsp;</label>
        <div class="item">
          <button type="submit" class="button"><i class="icon-check"></i><?php echo !empty($v['id'])?'编辑':'添加'; ?></button>
        </div>
      </li>
    </ul>
  </form>
</div>
</div>
<script> 
sycms.submitform("<?php echo url('index',['nid'=>$nid]); ?>"); 
layui.use('laydate', function(){
  var laydate = layui.laydate;
  laydate.render({
    elem: '#datetime' //指定元素
	,type: 'datetime'
	,isInitValue:false
  });
});
function _checkbox(name){
   var v = $("input[name="+name+"]").val();
       v = v==0?1:0;
   $("input[name="+name+"]").val(v);	
}
$(function(){
	$(".box-head ul li").click(function(){
		$(this).addClass("on").siblings().removeClass("on");
		$(".tabcon").hide().eq($(this).index()).show();
	})	
})
</script>